package java_collection.set;

import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;

public class AddAllTest {

	public static void main(String[] args) {
		
		Set<Integer> set = new HashSet<>();
		set.add(1);
		set.add(2);
		set.add(3);
		
		Collection subList = new HashSet<>();
		subList.add(10);
		subList.add(11);
		subList.add(12);
		
		set.addAll(subList);
		// Set = [1,2,3,10,11,12]
		
		System.out.println("---");
		print(set);
		
		set.removeAll(Arrays.asList(1,2,3));
		System.out.println("---");
		print(set);
	}
	static void print(Collection<Integer> collection){
		for(Integer c: collection){
			System.out.println(c);
		}
	}
}
